from interface.Event import Event


class EventCase:
    def __init__(self):
        self.event = Event()

    def test_add_event(self):
        # 准备测试数据
        data = {
            "eid": "11666887",
            "name": "莓莓妹儿",
            "limit": "20",
            "status": "1",
            "address": "武汉源码时代",
            "start_time": "2022-07-25"
        }
        # 调用接口对象层的请求方法
        result = self.event.add_event(data)
        print(result)
        # 断言响应状态码
        status_code = result.get("status_code")
        assert status_code == 200
        # 断言返回码status
        status = result.get("body").get("status")
        assert status == 10200
        # 断言message
        message = result.get("body").get("message")
        assert message == "add event success"


if __name__ == '__main__':
    event_case = EventCase()
    event_case.test_add_event()
